﻿<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/commons/taglibs.jsp"%>
<!--留言本-->
<div id="mod_leaveWord" class="shop_box_body clearfix">
	<div class="shop_box_header clearfix">
    	<span class="title">留言本</span>
    </div>
    <div class="shop_box_content clearfix">
    		<!-- no login -->
    		<c:if test="${empty current_user}">
    			<form action="${config.ssoPostUrl }" method="post" target="_parent">
					<div class="show_list_28">
						用户名: <input type="text" name="username" class="sl28Usern" maxlength="50" />
						密　码: <input type="password" name="password" class="sl28Usern" maxlength="50" />
						<input type="hidden" value="${currenturl }" name="service" id="service">
						<input type="hidden" value="knet" name="serviceToken" id="serviceToken">
						<input type="submit" value="登录" />
						<a href="#">新用户注册</a>
					</div>
					<div class="show_list_29">
						<textarea id="leaveWordContent" name="content" readonly="readonly"></textarea>
					</div>
				</form>
			</c:if>
			<c:if test="${not empty current_user}">
				<form action="/shop/${username }/news/${id}.html" method="post">
					<div class="show_list_29">
						<textarea id="leaveWordContent" name="content"></textarea>
					</div>
					<input type="hidden" name="userId" value="${current_user.user.id }" />
					<input type="hidden" name="newsId" value="${id }" />
					<input type="hidden" name="nickName" value="${current_user.userContact.nickName }" />
					<div class="show_list_30">
					<input type="submit" value="加上去" maxlength="1000"/></div>
				</form>
			</c:if>
		<div class="show_list_31">网友回复</div>
		<%--为空 --%>
		<c:if test="${empty page.result }">
			<div class="show_list_32">还没有人发表评论  <a href="#leaveWordContent" onclick="$('#leaveWordContent').focus()">来坐第一个沙发</a></div>
		</c:if>
		<%--/为空 --%>
		<%--留言列表--%>
		<c:if test="${not empty page.result }">
			<ul class="show_list_33">
				<c:forEach items="${page.result }" var="comment">
					<li>
						<h5>${comment.nickName }</h5>
						<h6>${comment.content }</h6>
						<h7 class="clearfix"><i><fmt:formatDate value="${comment.createDate }" pattern="yyyy-MM-dd HH:mm:ss"></fmt:formatDate></i><b><a href="#">引用</a></b></h7>
					</li>
				</c:forEach>
					<li>
						<h5></h5>
						<h6></h6>
						<h7 class="clearfix"><i></i>
						        <!-- page -->
							      <form action="" method="get" name="pageform" id="pageform" class="shop_page_form">
								      	<sst:page form="pageform" pageBean="${page }" />
							      </form>
						</h7>
					</li>
			</ul>
		</c:if>
		<%--/留言列表--%>
    </div>
    <div class="shop_box_footer clearfix"></div>
</div>
<!--/留言本-->